import Vue from 'vue'
import Vuex from 'vuex'
import getters from './getters'
import mutations from './mutations'
import actions from './actions'
Vue.use(Vuex)

let userinfo = {
	avatar: 'https://api.youdaike.com/static/index/logo_default.png',
	nickname: '',
	mobile: '未绑定',
	id: 0
};

const store = new Vuex.Store({
	state: {
		//公共的变量，这里的变量不能随便修改，只能通过触发mutations的方法才能改变
		// 个人信息
		userinfo:userinfo,
	},
	//相当于同步的操作/ 获取内容
	mutations,
	actions,
	// 获取
	getters
})
export default store